Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tex. #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix tex. #26

wants to merge 3 commits into from

Conversation

nagexiucai
Copy link

@nagexiucai nagexiucai commented Mar 24, 2018

something of math, such as formula, in tex are not renderd properly.

and something like description of matplotlib.pyplot's output <matplotlib.figure.Figure at 0xd4f9860> may be customized hidden.

@kokes
Copy link
Owner

kokes commented Mar 24, 2018

Cool, I wondered what the best to do this was. I had a similar thought but never knew if there were any caveats.

To finish this, I think we'd need to add KaTeX to this (I've been eyeing that one), either as an explicit script import, or lazy loaded if $$ or $ is present in any of the markdown cells. So that it works out of the box. We'll then get a few math notebooks to test it out.

Also, you don't have to sign your code, there's git blame for that :-)

@@ -183,6 +196,7 @@ var nbv = (function() {

dm = d.createElement('pre');
dm.style.margin = 0;
dm.className = 'illustration-title'; // fixed: some outputs may be customized hidden, by nagexiucai
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this class referring to?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, maybe i should comment it?

users can make 'display_data' hidden by using the 'illustration-title' like "display: none;", we konw.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd drop it, let the illustration title be seen.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that is good, i can understand, the "illustration-title" is a temporary thing of mine, styles should be managed elsewhere.

lib/nbv.js Outdated
// for exsample: render tex by '[kates](https://github.com/Khan/KaTeX)
// var maths = document.getElementsByClassName("math");
// for(var i=0; i<maths.length; i++) {
// katex.render(maths[i].getAttribute("tex"), maths[i], {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you'll be using this code to implement KaTeX, please use single quotes instead of double quotes, just for consistency sake.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, it is my fault.

@nagexiucai
Copy link
Author

Yes, "explicit script import, or lazy loaded if $$ or $ is present in any of the markdown cells" is good.
But i am not so good at javascript, take the wheel please, I will learn the changes.

@kokes
Copy link
Owner

kokes commented Mar 26, 2018

I'd just <script> a Cloudflare-hosted version of KaTeX (a current stable version, minified) into viewer.html and scaffold.html.

Then you can uncomment that piece of code that does the rendering and then we can both test it live!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants